package ca.usherbrooke.domus.sipnmove2.controller.call;

import ca.usherbrooke.domus.sipnmove2.controller.ActionController;
import ca.usherbrooke.domus.sipnmove2.model.call.Call;
import ca.usherbrooke.domus.sipnmove2.view.call.CallView;

/**
 * Send socket message action controller
 */
public class SendSocketMessageActionController implements ActionController {

	/**
	 * Call view
	 */
	private CallView callView;

	/**
	 * Call
	 */
	private Call call;
	
	@Override
	public void doAction() {
		String message = callView.getMessageTextField().getText();
		call.getCommunication().sendMessage(message);
		
		callView.getMessageTextField().setText("");
	}

	/**
	 * @return the sipSocketCallView
	 */
	public CallView getCallView() {
		return callView;
	}

	/**
	 * @param sipSocketCallView the sipSocketCallView to set
	 */
	public void setCallView(CallView sipSocketCallView) {
		this.callView = sipSocketCallView;
	}


	/**
	 * @return the call
	 */
	public Call getCall() {
		return call;
	}


	/**
	 * @param call the call to set
	 */
	public void setCall(Call call) {
		this.call = call;
	}

}
